package sipus.database.model;

// Generated Apr 16, 2010 2:27:16 PM by Hibernate Tools 3.2.4.CR1

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Bank generated by hbm2java
 */
@Entity
@Table(schema = "public", name = "online_users")
public class OnlineUsers implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2463821577548439808L;
	private Long id;
	private String oleh;public String toString(){return nama;}

	public void setOleh(String oleh) {
		this.oleh = oleh;
	}

	public String getOleh() {
		return oleh;
	}

	private Date tanggal_dirubah = new Date();

	public void setTanggal_dirubah(Date tanggal_dirubah) {
		this.tanggal_dirubah = tanggal_dirubah;
	}

	@Temporal(TemporalType.TIMESTAMP)
	public Date getTanggal_dirubah() {
		return tanggal_dirubah;
	}

	private String nama;
	private LogLogin login;
	private Tbmuser tbmuser;

	private AccessedUsers accessedUsers;
	private String host;

	public OnlineUsers() {
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", insertable = false, unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "nama", nullable = false, length = 250)
	public String getNama() {
		return this.nama;
	}

	public void setNama(String nama) {
		this.nama = nama;
	}

	public void setLogin(LogLogin login) {
		this.login = login;
	}

	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
	@JoinColumn(name = "login", nullable = true)
	public LogLogin getLogin() {
		return login;
	}

	public void setTbmuser(Tbmuser tbmuser) {
		this.tbmuser = tbmuser;
	}

	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
	@JoinColumn(name = "tbmuser", nullable = true)
	public Tbmuser getTbmuser() {
		return tbmuser;
	}

	public void setAccessedUsers(AccessedUsers accessedUsers) {
		this.accessedUsers = accessedUsers;
	}

	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
	@JoinColumn(name = "accessed_users", nullable = true)
	public AccessedUsers getAccessedUsers() {
		return accessedUsers;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public String getHost() {
		return host;
	}

}
